package com.achao.frontdeskmanage.service.impl;

import com.achao.basecommon.entity.MusicManagerDO;
import com.achao.basecommon.entity.MusicUserDO;
import com.achao.frontdeskmanage.dao.MusicUserDao;
import com.achao.frontdeskmanage.service.MusicUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 描述：前台用户操作-业务层实现类
 *
 * @Author：yangchao
 * @CreateDate：2023/2/8 16:27
 */
@Service
public class MusicUserServiceImpl implements MusicUserService {

    @Autowired
    private MusicUserDao musicUserDao;

    /**
     *  描述：查找用户-根据用户名作条件
     *      @Param：musicUserDO
     *      @Returen：MusicUserDO
     */
    @Override
    public MusicUserDO queryRegisterUser(MusicUserDO musicUserDO) {
        QueryWrapper<MusicUserDO> wrapper = new QueryWrapper<>();
        wrapper.eq("USER_NAME",musicUserDO.getUserName().trim());
        return musicUserDao.selectOne(wrapper);
    }

    /**
     *  描述：用户注册
     *      @Param：musicUserDO
     *      @Returen：int
     */
    @Override
    public Integer insertRegistryMangage(MusicUserDO musicUserDO) {
        return musicUserDao.insert(musicUserDO);
    }
}
